package shiqi.controller;

import org.springframework.boot.autoconfigure.EnableAutoConfiguration;
import org.springframework.boot.autoconfigure.jdbc.DataSourceAutoConfiguration;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;
import shiqi.pojo.Student;

import java.util.ArrayList;
import java.util.List;

@Controller //用于后台开发，一般是有页面的
@RequestMapping("stu")
public class StudentController {

    @RequestMapping("list")
    public String list(Model model) {
        model.addAttribute("username","shiqi");
        model.addAttribute("age",23);
        List<Student> students = new ArrayList<>();
        students.add(new Student(100, "shiqi","男"));
        students.add(new Student(101, "yimi","女"));
        model.addAttribute("students",students);

        return "stu/list";
    }
}
